package com.train.course.service.impl;

import com.train.course.domain.VideoEpisode;
import com.train.course.mapper.VideoEpisodeMapper;
import com.train.course.service.IVideoEpisodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 课程视频集 服务层实现
 */
@Service
public class VideoEpisodeServiceImpl implements IVideoEpisodeService {

    @Autowired
    private VideoEpisodeMapper videoEpisodeMapper;

    /**
     * 查询视频集信息
     *
     * @param episodeId 视频集ID
     * @return 视频集信息
     */
    @Override
    public VideoEpisode selectVideoEpisodeById(Long episodeId) {
        return videoEpisodeMapper.selectVideoEpisodeById(episodeId);
    }

    /**
     * 查询视频集列表
     *
     * @param videoEpisode 视频集信息
     * @return 视频集集合
     */
    @Override
    public List<VideoEpisode> selectVideoEpisodeList(VideoEpisode videoEpisode) {
        return videoEpisodeMapper.selectVideoEpisodeList(videoEpisode);
    }

    /**
     * 根据课程ID查询视频集列表
     *
     * @param courseId 课程ID
     * @return 视频集集合
     */
    @Override
    public List<VideoEpisode> selectVideoEpisodeListByCourseId(Long courseId) {
        return videoEpisodeMapper.selectVideoEpisodeListByCourseId(courseId);
    }

    /**
     * 新增视频集
     *
     * @param videoEpisode 视频集信息
     * @return 结果
     */
    @Override
    public int insertVideoEpisode(VideoEpisode videoEpisode) {
        return videoEpisodeMapper.insertVideoEpisode(videoEpisode);
    }

    /**
     * 修改视频集
     *
     * @param videoEpisode 视频集信息
     * @return 结果
     */
    @Override
    public int updateVideoEpisode(VideoEpisode videoEpisode) {
        return videoEpisodeMapper.updateVideoEpisode(videoEpisode);
    }

    /**
     * 删除视频集信息
     *
     * @param episodeId 视频集ID
     * @return 结果
     */
    @Override
    public int deleteVideoEpisodeById(Long episodeId) {
        return videoEpisodeMapper.deleteVideoEpisodeById(episodeId);
    }

    /**
     * 批量删除视频集信息
     *
     * @param episodeIds 需要删除的视频集ID数组
     * @return 结果
     */
    @Override
    public int deleteVideoEpisodeByIds(Long[] episodeIds) {
        return videoEpisodeMapper.deleteVideoEpisodeByIds(episodeIds);
    }
}